package com.knowif.backend.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.knowif.pojo.UserComment;
import com.knowif.pojo.UserHelpful;
import com.knowif.search.SearchCondition;
import com.knowif.service.UserComment_service;
import com.knowif.service.UserHelpful_service;
import com.knowif.system.model.RestBean;

@Service
public class UserCommentService {

	@Autowired
	private UserComment_service userComment_service;

	@Autowired
	private UserHelpful_service userHelpful_service;
	
	/**
	 * @author: xingyao 
	 * @Description:  保存用户评论信息
	 * @param userComment
	 * @return
	 */
	public RestBean<?> saveUserComment(UserComment userComment){
		if(userComment == null){
			return RestBean.buildError("请填写评论内容");
		}
		return userComment_service.saveUserComment(userComment);
	}
	

	public RestBean<?> selectMoreComment(SearchCondition searchCondition){
		if(searchCondition == null){
			return RestBean.buildError("请输入查询条件");
		}
		return userComment_service.selectMoreUserCommnet(searchCondition);
	}
	
	
	
	
	 /**
     * 删除userComment
     * @param userCommentId
     */
    public RestBean<?> deleteUserComment(int userCommentId){
    	return userComment_service.deleteUserComment(userCommentId);
    }
    
    
   
    
    
    
    
    /**
	 * @author: xingyao 
	 * @Description:  用于用户点赞
	 * @param userHelpful
	 * @return
	 */
	public RestBean<?> isUsed(UserHelpful userHelpful){
		return userHelpful_service.isUsed(userHelpful);
	}
}
















